/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package impss;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Mikehood
 */
@Entity
@Table(name = "designer")
@NamedQueries({@NamedQuery(name = "Designer.findAll", query = "SELECT d FROM Designer d"), @NamedQuery(name = "Designer.findByDesignerID", query = "SELECT d FROM Designer d WHERE d.designerID = :designerID"), @NamedQuery(name = "Designer.findByDesignerName", query = "SELECT d FROM Designer d WHERE d.designerName = :designerName"), @NamedQuery(name = "Designer.findByDesignerPrice", query = "SELECT d FROM Designer d WHERE d.designerPrice = :designerPrice")})
public class Designer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "designerID")
    private Integer designerID;
    @Column(name = "designerName")
    private String designerName;
    @Column(name = "designerPrice")
    private Integer designerPrice;
    @OneToMany(mappedBy = "designerID")
    private Collection<Phone> phoneCollection;

    public Designer() {
    }

    public Designer(Integer designerID) {
        this.designerID = designerID;
    }

    public Integer getDesignerID() {
        return designerID;
    }

    public void setDesignerID(Integer designerID) {
        this.designerID = designerID;
    }

    public String getDesignerName() {
        return designerName;
    }

    public void setDesignerName(String designerName) {
        this.designerName = designerName;
    }

    public Integer getDesignerPrice() {
        return designerPrice;
    }

    public void setDesignerPrice(Integer designerPrice) {
        this.designerPrice = designerPrice;
    }

    public Collection<Phone> getPhoneCollection() {
        return phoneCollection;
    }

    public void setPhoneCollection(Collection<Phone> phoneCollection) {
        this.phoneCollection = phoneCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (designerID != null ? designerID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Designer)) {
            return false;
        }
        Designer other = (Designer) object;
        if ((this.designerID == null && other.designerID != null) || (this.designerID != null && !this.designerID.equals(other.designerID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "impss.Designer[designerID=" + designerID + "]";
    }

}
